package br.com.queroprestador.sevices;

import br.com.queroprestador.model.User;
import br.com.queroprestador.util.HttpConnector;

public class AutenticadorApi {

	
	public String signIn(String email, String pass){
		
		String param = String.format("/endpoint?email=%s&password=%s&method=get&endpoint=Authenticator", email, pass);
		HttpConnector http = new HttpConnector("http://sautenticador.appspot.com");
		String resp = http.request(param);
		
		return resp;
	}
	
	public boolean addUser(User user){
		
		String param = String.format("/endpoint?email=%s&password=%s&name=%s&cpf=%s&method=add&endpoint=Authenticator",user.getEmail(), user.getPassword(), user.getName(), user.getCpf());
		HttpConnector http = new HttpConnector("http://sautenticador.appspot.com");
		http.request(param);
		
		
		return true;
	}
}
